package com.ha8.netease.views.team.comment
{
	import com.ha8.netease.PrivateNotify;
	import com.ha8.netease.models.WeiboProxy;
	import com.ha8.netease.models.vo.CommentReqVO;
	import com.rogo.mvc.sub.mediator.Mediator;
	
	public class ReceiveCommentMediator extends Mediator
	{
		public function ReceiveCommentMediator(viewComponent:Object)
		{
			super(NAME, viewComponent);
		}
		
		//--------------------------------------------------------------------------
		//
		//  Constants
		//
		//--------------------------------------------------------------------------
		
		public static const NAME:String = 'receiveCommentMediator';
		
		//--------------------------------------------------------------------------
		//
		//  Variables
		//
		//--------------------------------------------------------------------------
		
		private var vo:CommentReqVO;
		
		//--------------------------------------------------------------------------
		//
		//  Overridden Methods
		//
		//--------------------------------------------------------------------------
		
		override public function onRegister():void
		{
			vo = new CommentReqVO();
			requestData();
		}
		
		override public function listNotificationInterests():Array
		{
			return [PrivateNotify.GET_COMMENT_RESULT, 
				PrivateNotify.GET_COMMENT_ERROR];
		}
		
		//--------------------------------------------------------------------------
		//
		//  Methods
		//
		//--------------------------------------------------------------------------
		
		public function get view():ReceiveComment
		{
			return viewComponent as ReceiveComment;
		}
		
		public function get proxy():WeiboProxy
		{
			return facade.retrieveProxy(WeiboProxy.NAME) as WeiboProxy;
		}
		
		public function requestData():void
		{
			proxy.getComment(vo);
		}
		
	}
}